namespace webapiday3 {
    // 计算两个日期之间的天数差

    function getDaysBetweenDates(date1: Date, date2: Date): number {

        const startDate: Date = new Date(date1);
        const endDate: Date = new Date(date2);
        const timeDifference: number = endDate.getTime() - startDate.getTime();
        const daysDifference: number = timeDifference / (1000 * 3600 * 24);
        return Math.abs(Math.ceil(daysDifference))

    }
    console.log(getDaysBetweenDates(new Date('2023-01-01'), new Date('2023-01-10')));
}
